package com.intramirror.wd.model.enums;

import java.util.HashMap;
import java.util.Map;

public enum CouponGettingTypeEnum {
    AUTO(1,"自动获得"),
    CLICK(2,"点击领取");


    private Integer key;
    private String value;

    CouponGettingTypeEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static Map<Integer, String> map;

    static {
        map = new HashMap<>();
        for (CouponGettingTypeEnum item : values()) {
            map.put(item.getKey(), item.getValue());
        }
    }

    public static String getValueByKey(int key) {
        return map.get(key);
    }
}
